import request from '@/utils/request'

// api地址
const api = {
	list: '/api/category.category/getCategoryList',
	detail: '/index.php?s=/api/goods.goods/getGoodsList',
	postOrder:'/index.php?s=/api/order/buyCart',
	batchPostOrder:'/index.php?s=/api/order/batchBuyCart',
	getNotice:'/api/Content/getNotice',
	cardorcode:'/api/goods.goods/cardorcode',
	chenkcoupons:'/api/order/chenkcoupons',
	getooodscommonl:'/api/goods.goods/getooodscommonl'
}
// 卡类列表
export const list = param => {
  return request.get(api.list, param )
}
// 卡类详情
export const detail = param => {
	let str = api.detail
	if(param.s){
		str = api.detail + '/s=/'+param.s
	}
	delete param.s
  return request.get(str, param )
}
// 单卡提交
export const postOrder = param => {
  return request.post(api.postOrder, param )
}
// 批量提交
export const batchPostOrder = param => {
  return request.post(api.batchPostOrder, param )
}
// 用户需知
export const getNotice = param => {
  return request.get(api.getNotice, param )
}

// 用户需知
export const cardorcode = param => {
  return request.get(api.cardorcode, param )
}
// 提价券能否使用判断
export const chenkcoupons = param => {
  return request.get(api.chenkcoupons, param )
}
// 提价券能否使用判断
export const getooodscommonl = param => {
  return request.post(api.getooodscommonl, param )
}